% Reads a Cicero log file from an HDF5 file and writes it to the current
% folder with its original filename, so that it can be read by Cicero or
% Elgin. 
% Note that different runs of the same sequence will have nearly the same
% log file (the only difference will be the timestamp and the run iteration
% number).

function y = RecoverLogFile(hdfFileName)

    logfile = h5read(hdfFileName,'/LogFile');
    filename = h5readatt(hdfFileName,'/LogFile','filename');
    
    f = fopen(filename{1},'w');
    fwrite(f,logfile,'int8');
    
    fclose(f);